package com.zhiwang.xiaoqu.util

import android.content.Context
import android.widget.ImageView
import com.bumptech.glide.Glide
import com.bumptech.glide.request.RequestOptions
import com.youth.banner.loader.ImageLoader
import com.zhiwang.xiaoqu.widget.glide.transformation.RoundedCornersTransformation

object BannerImageLoader : ImageLoader() {

    val requestOpts = RequestOptions()
        .transform(RoundedCornersTransformation(20, 10))

    override fun displayImage(context: Context, path: Any, imageView: ImageView) {
        Glide.with(context)
            .applyDefaultRequestOptions(requestOpts)
            .load(path)
            .into(imageView)
    }
}